﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;

namespace IHISCETeim.Web.MachineSys.ProdModel
{
    public partial class PToolingChargeEdit : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.修改 };
            }
        }
        protected override string DWZRef
        {
            get { return "PToolingChargeList"; }
        }

        #region
        /// <summary>
        /// 需要修改的用户ID
        /// </summary>
        protected int ID
        {
            get
            {
                return GetRequestValue<int>("ID");
            }
        }

        private PToolingChargeInfo _obj;
        protected PToolingChargeInfo obj
        {
            get
            {
                if (_obj == null)
                    _obj = PToolingChargeController.GetById(ID);
                return _obj;
                //OMenuController.ge
            }
        }

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "edit")
            {
                addmenu();
                
            }
        }

        protected void addmenu()
        {
            PToolingChargeInfo obj2 = Request.SerializableObject<PToolingChargeInfo>();

          
            this.AddLog(Permission.修改, obj, obj2);
            if (PToolingChargeController.Update(obj2))
                SuccessJson("修改成功", "");
            else
                ErrorJson("修改失败", "");
        }
    }
}